package com.synthefact.daj.model;

import java.util.Set;

/**
 * A network is a collection of nodes that interact.
 * <p>
 * Copyright (C) 2011 Synthefact
 * <p>
 * Based on code from (c) 1997, Wolfgang Schreiner <Wolfgang.Schreiner@risc.uni-linz.ac.at> 
 * http://www.risc.uni-linz.ac.at/software/daj
 */
public interface NetworkIf {

    /**
     * Gets all the {@link INodes} in the network.
     * 
     * @return all the nodes in the network.
     */
    Set<NodeIf> getNodes();

    /**
     * Gets the count of {@link NodeIf} in the network.
     * 
     * @return an integer, representing the count of nodes in the network.
     */
    int getNodeCount();

    /**
     * Add a {@link NodeIf} to this network.
     * 
     * <p>
     * node can not be <code>null</code>.
     * 
     * @param node
     *            the node to add to the network
     */
    void addNode(NodeIf node);

    /**
     * Terminates the given node in the network.
     * 
     * @param node
     *            node to terminate.
     */
    void terminate(NodeIf node);

    /**
     * Establish a sending and receiving channel for every node in the network.
     */
    void fullyConnect();
}
